package com.zoe.onelink.test.container.support.ctr.impl;

import com.zoe.onelink.test.container.support.ctr.init.ContainerEnvironmentInitializer;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2023</p>
 * <p>公司: 智业软件股份有限公司</p>
 *
 * @version: 1.0
 * @author: ruansheng
 * @date: 2023-01-15
 */
public class OracleContainer extends org.testcontainers.containers.OracleContainer implements ContainerEnvironmentInitializer {

    public OracleContainer(String dockerImageName) {
        super(dockerImageName);
    }

    @Override
    public void preStart() {

    }

    @Override
    public void afterStarted() {
        System.setProperty("spring.datasource.url", this.getJdbcUrl());
        System.setProperty("spring.datasource.driver-class-name", this.getDriverClassName());
        System.setProperty("spring.datasource.username", this.getUsername());
        System.setProperty("spring.datasource.password", this.getPassword());
    }
}
